'
' Script Name: color-picker
' Author: David Anderson
' Purpose: utilise standard html color name and the corresponding hex values
' Date: 14-Feb_2019
'
dim color_array (154,2)
'loadup color_array
color_array(0,0)="#BLACK"
color_array(0,1)="#000000"
color_array(1,0)="#NAVY"
color_array(1,1)="#000080"
color_array(2,0)="#DARKBLUE"
color_array(2,1)="#00008B"
color_array(3,0)="#MEDIUMBLUE"
color_array(3,1)="#0000CD"
color_array(4,0)="#BLUE"
color_array(4,1)="#0000FF"
color_array(5,0)="#DARKGREEN"
color_array(5,1)="#006400"
color_array(6,0)="#GREEN"
color_array(6,1)="#008000"
color_array(7,0)="#TEAL"
color_array(7,1)="#008080"
color_array(8,0)="#DARKCYAN"
color_array(8,1)="#008B8B"
color_array(9,0)="#DEEPSKYBLUE"
color_array(9,1)="#00BFFF"
color_array(10,0)="#DARKTURQUOISE"
color_array(10,1)="#00CED1"
color_array(11,0)="#MEDIUMSPRINGGREEN"
color_array(11,1)="#00FA9A"
color_array(12,0)="#LIME"
color_array(12,1)="#00FF00"
color_array(13,0)="#SPRINGGREEN"
color_array(13,1)="#00FF7F"
color_array(14,0)="#AQUA"
color_array(14,1)="#00FFFF"
color_array(15,0)="#CYAN"
color_array(15,1)="#00FFFF"
color_array(16,0)="#MIDNIGHTBLUE"
color_array(16,1)="#191970"
color_array(17,0)="#DODGERBLUE"
color_array(17,1)="#1E90FF"
color_array(18,0)="#LIGHTSEAGREEN"
color_array(18,1)="#20B2AA"
color_array(19,0)="#FORESTGREEN"
color_array(19,1)="#228B22"
color_array(20,0)="#SEAGREEN"
color_array(20,1)="#2E8B57"
color_array(21,0)="#DARKSLATEGREY"
color_array(21,1)="#2F4F4F"
color_array(22,0)="#LIMEGREEN"
color_array(22,1)="#32CD32"
color_array(23,0)="#MEDIUMSEAGREEN"
color_array(23,1)="#3CB371"
color_array(24,0)="#TURQUOISE"
color_array(24,1)="#40E0D0"
color_array(25,0)="#ROYALBLUE"
color_array(25,1)="#4169E1"
color_array(26,0)="#STEELBLUE"
color_array(26,1)="#4682B4"
color_array(27,0)="#DARKSLATEBLUE"
color_array(27,1)="#483D8B"
color_array(28,0)="#MEDIUMTURQUOISE"
color_array(28,1)="#48D1CC"
color_array(29,0)="#INDIGO"
color_array(29,1)="#4B0082"
color_array(30,0)="#DARKOLIVEGREEN"
color_array(30,1)="#556B2F"
color_array(31,0)="#CADETBLUE"
color_array(31,1)="#5F9EA0"
color_array(32,0)="#CORNFLOWERBLUE"
color_array(32,1)="#6495ED"
color_array(33,0)="#REBECCAPURPLE"
color_array(33,1)="#663399"
color_array(34,0)="#MEDIUMAQUAMARINE"
color_array(34,1)="#66CDAA"
color_array(35,0)="#DIMGREY"
color_array(35,1)="#696969"
color_array(36,0)="#SLATEBLUE"
color_array(36,1)="#6A5ACD"
color_array(37,0)="#OLIVEDRAB"
color_array(37,1)="#6B8E23"
color_array(38,0)="#SLATEGREY"
color_array(38,1)="#708090"
color_array(39,0)="#LIGHTSLATEGREY"
color_array(39,1)="#778899"
color_array(40,0)="#MEDIUMSLATEBLUE"
color_array(40,1)="#7B68EE"
color_array(41,0)="#LAWNGREEN"
color_array(41,1)="#7CFC00"
color_array(42,0)="#CHARTREUSE"
color_array(42,1)="#7FFF00"
color_array(43,0)="#AQUAMARINE"
color_array(43,1)="#7FFFD4"
color_array(44,0)="#MAROON"
color_array(44,1)="#800000"
color_array(45,0)="#PURPLE"
color_array(45,1)="#800080"
color_array(46,0)="#OLIVE"
color_array(46,1)="#808000"
color_array(47,0)="#GREY"
color_array(47,1)="#808080"
color_array(48,0)="#SKYBLUE"
color_array(48,1)="#87CEEB"
color_array(49,0)="#LIGHTSKYBLUE"
color_array(49,1)="#87CEFA"
color_array(50,0)="#BLUEVIOLET"
color_array(50,1)="#8A2BE2"
color_array(51,0)="#DARKRED"
color_array(51,1)="#8B0000"
color_array(52,0)="#DARKMAGENTA"
color_array(52,1)="#8B008B"
color_array(53,0)="#SADDLEBROWN"
color_array(53,1)="#8B4513"
color_array(54,0)="#DARKSEAGREEN"
color_array(54,1)="#8FBC8F"
color_array(55,0)="#LIGHTGREEN"
color_array(55,1)="#90EE90"
color_array(56,0)="#MEDIUMPURPLE"
color_array(56,1)="#9370DB"
color_array(57,0)="#DARKVIOLET"
color_array(57,1)="#9400D3"
color_array(58,0)="#PALEGREEN"
color_array(58,1)="#98FB98"
color_array(59,0)="#DARKORCHID"
color_array(59,1)="#9932CC"
color_array(60,0)="#YELLOWGREEN"
color_array(60,1)="#9ACD32"
color_array(61,0)="#SIENNA"
color_array(61,1)="#A0522D"
color_array(62,0)="#BROWN"
color_array(62,1)="#A52A2A"
color_array(63,0)="#DARKGREY"
color_array(63,1)="#A9A9A9"
color_array(64,0)="#LIGHTBLUE"
color_array(64,1)="#ADD8E6"
color_array(65,0)="#GREENYELLOW"
color_array(65,1)="#ADFF2F"
color_array(66,0)="#PALETURQUOISE"
color_array(66,1)="#AFEEEE"
color_array(67,0)="#LIGHTSTEELBLUE"
color_array(67,1)="#B0C4DE"
color_array(68,0)="#POWDERBLUE"
color_array(68,1)="#B0E0E6"
color_array(69,0)="#FIREBRICK"
color_array(69,1)="#B22222"
color_array(70,0)="#DARKGOLDENROD"
color_array(70,1)="#B8860B"
color_array(71,0)="#MEDIUMORCHID"
color_array(71,1)="#BA55D3"
color_array(72,0)="#ROSYBROWN"
color_array(72,1)="#BC8F8F"
color_array(73,0)="#DARKKHAKI"
color_array(73,1)="#BDB76B"
color_array(74,0)="#SILVER"
color_array(74,1)="#C0C0C0"
color_array(75,0)="#MEDIUMVIOLETRED"
color_array(75,1)="#C71585"
color_array(76,0)="#INDIANRED "
color_array(76,1)="#CD5C5C"
color_array(77,0)="#PERU"
color_array(77,1)="#CD853F"
color_array(78,0)="#CHOCOLATE"
color_array(78,1)="#D2691E"
color_array(79,0)="#TAN"
color_array(79,1)="#D2B48C"
color_array(80,0)="#LIGHTGREY"
color_array(80,1)="#D3D3D3"
color_array(81,0)="#THISTLE"
color_array(81,1)="#D8BFD8"
color_array(82,0)="#ORCHID"
color_array(82,1)="#DA70D6"
color_array(83,0)="#GOLDENROD"
color_array(83,1)="#DAA520"
color_array(84,0)="#PALEVIOLETRED"
color_array(84,1)="#DB7093"
color_array(85,0)="#CRIMSON"
color_array(85,1)="#DC143C"
color_array(86,0)="#GAINSBORO"
color_array(86,1)="#DCDCDC"
color_array(87,0)="#PLUM"
color_array(87,1)="#DDA0DD"
color_array(88,0)="#BURLYWOOD"
color_array(88,1)="#DEB887"
color_array(89,0)="#LIGHTCYAN"
color_array(89,1)="#E0FFFF"
color_array(90,0)="#LAVENDER"
color_array(90,1)="#E6E6FA"
color_array(91,0)="#DARKSALMON"
color_array(91,1)="#E9967A"
color_array(92,0)="#VIOLET"
color_array(92,1)="#EE82EE"
color_array(93,0)="#PALEGOLDENROD"
color_array(93,1)="#EEE8AA"
color_array(94,0)="#LIGHTCORAL"
color_array(94,1)="#F08080"
color_array(95,0)="#KHAKI"
color_array(95,1)="#F0E68C"
color_array(96,0)="#ALICEBLUE"
color_array(96,1)="#F0F8FF"
color_array(97,0)="#HONEYDEW"
color_array(97,1)="#F0FFF0"
color_array(98,0)="#AZURE"
color_array(98,1)="#F0FFFF"
color_array(99,0)="#SANDYBROWN"
color_array(99,1)="#F4A460"
color_array(100,0)="#WHEAT"
color_array(100,1)="#F5DEB3"
color_array(101,0)="#BEIGE"
color_array(101,1)="#F5F5DC"
color_array(102,0)="#WHITESMOKE"
color_array(102,1)="#F5F5F5"
color_array(103,0)="#MINTCREAM"
color_array(103,1)="#F5FFFA"
color_array(104,0)="#GHOSTWHITE"
color_array(104,1)="#F8F8FF"
color_array(105,0)="#SALMON"
color_array(105,1)="#FA8072"
color_array(106,0)="#ANTIQUEWHITE"
color_array(106,1)="#FAEBD7"
color_array(107,0)="#LINEN"
color_array(107,1)="#FAF0E6"
color_array(108,0)="#LIGHTGOLDENRODYELLOW"
color_array(108,1)="#FAFAD2"
color_array(109,0)="#OLDLACE"
color_array(109,1)="#FDF5E6"
color_array(110,0)="#RED"
color_array(110,1)="#FF0000"
color_array(111,0)="#FUCHSIA"
color_array(111,1)="#FF00FF"
color_array(112,0)="#MAGENTA"
color_array(112,1)="#FF00FF"
color_array(113,0)="#DEEPPINK"
color_array(113,1)="#FF1493"
color_array(114,0)="#ORANGERED"
color_array(114,1)="#FF4500"
color_array(115,0)="#TOMATO"
color_array(115,1)="#FF6347"
color_array(116,0)="#HOTPINK"
color_array(116,1)="#FF69B4"
color_array(117,0)="#CORAL"
color_array(117,1)="#FF7F50"
color_array(118,0)="#DARKORANGE"
color_array(118,1)="#FF8C00"
color_array(119,0)="#LIGHTSALMON"
color_array(119,1)="#FFA07A"
color_array(120,0)="#ORANGE"
color_array(120,1)="#FFA500"
color_array(121,0)="#LIGHTPINK"
color_array(121,1)="#FFB6C1"
color_array(122,0)="#PINK"
color_array(122,1)="#FFC0CB"
color_array(123,0)="#GOLD"
color_array(123,1)="#FFD700"
color_array(124,0)="#PEACHPUFF"
color_array(124,1)="#FFDAB9"
color_array(125,0)="#NAVAJOWHITE"
color_array(125,1)="#FFDEAD"
color_array(126,0)="#MOCCASIN"
color_array(126,1)="#FFE4B5"
color_array(127,0)="#BISQUE"
color_array(127,1)="#FFE4C4"
color_array(128,0)="#MISTYROSE"
color_array(128,1)="#FFE4E1"
color_array(129,0)="#BLANCHEDALMOND"
color_array(129,1)="#FFEBCD"
color_array(130,0)="#PAPAYAWHIP"
color_array(130,1)="#FFEFD5"
color_array(131,0)="#LAVENDERBLUSH"
color_array(131,1)="#FFF0F5"
color_array(132,0)="#SEASHELL"
color_array(132,1)="#FFF5EE"
color_array(133,0)="#CORNSILK"
color_array(133,1)="#FFF8DC"
color_array(134,0)="#LEMONCHIFFON"
color_array(134,1)="#FFFACD"
color_array(135,0)="#FLORALWHITE"
color_array(135,1)="#FFFAF0"
color_array(136,0)="#SNOW"
color_array(136,1)="#FFFAFA"
color_array(137,0)="#YELLOW"
color_array(137,1)="#FFFF00"
color_array(138,0)="#LIGHTYELLOW"
color_array(138,1)="#FFFFE0"
color_array(139,0)="#IVORY"
color_array(139,1)="#FFFFF0"
color_array(140,0)="#WHITE"
color_array(140,1)="#FFFFFF"
color_array(141,0)="#DARKSLATEGRAY"
color_array(141,1)="#2F4F4F"
color_array(142,0)="#DIMGRAY"
color_array(142,1)="#696969"
color_array(143,0)="#SLATEGRAY"
color_array(143,1)="#708090"
color_array(144,0)="#LIGHTSLATEGRAY"
color_array(144,1)="#778899"
color_array(145,0)="#GRAY"
color_array(145,1)="#808080"
color_array(146,0)="#DARKGRAY"
color_array(146,1)="#A9A9A9"
color_array(147,0)="#LIGHTGRAY"
color_array(147,1)="#D3D3D3"
color_array(148,0)="#DARKSLATEGRAY"
color_array(148,1)="#2F4F4F"
color_array(149,0)="#APPLICATION"
color_array(149,1)="#ADD8E7"
color_array(150,0)="#IMPLEMENTATION"
color_array(150,1)="#FFC0CC"
color_array(151,0)="#MOTIVATION"
color_array(151,1)="#9370DC"
color_array(152,0)="#MOTIVATION"
color_array(152,1)="#9370DC"
color_array(153,0)="#PYSICAL"
color_array(153,1)="#98FB99"
color_array(154,0)="#TECHNOLOGY"
color_array(154,1)="#90EE91"

function ColorHexByName (colorName) 
dim i
	'Session.Output( "ColorName=" & colorName)
	ColorHexByName=""
	for i = 0 to Ubound(color_array)
		if color_array(i,0) = colorName then
			ColorHexByName = color_array(i,1)
			'Session.Output( "ColorHex(" & i & ") =" & ColorHexByName)
			exit for
		end if		
	next
end function

function ColorNameByHex (colorHex) 
dim i
	ColorNameByHex=""
	'Session.Output( "ColorHex=" & colorHex)
	
	for i = 0 to Ubound(color_array)
		if color_array(i,1) = colorHex then
			ColorNameByHex = color_array(i,0)
			'Session.Output( "ColorName(" & i & ") =" & ColorNameByHex)
			exit for
		end if		
	next
end function